package com.schpro.webexperiment.service.impl;

import com.schpro.webexperiment.dao.WxBelongMapper;
import com.schpro.webexperiment.dataobject.WxBelong;
import com.schpro.webexperiment.model.Belong;
import com.schpro.webexperiment.service.BelongService;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * TODO
 *
 * @author lss
 * @date 2019-02-27, Wed
 */
@Service
public class BelongServiceImpl implements BelongService {

  @Autowired
  private WxBelongMapper belongMapper;

  @Override
  public List<Belong> getAllBelongs() {
    return belongMapper.selectAll().stream().map(WxBelong::convertToModel).collect(Collectors.toList());
  }
}
